package com.lifetime.Util;

import java.sql.Date;

public class DateUtil {//将Java date转化为 数据库Date

    public static java.sql.Timestamp dtot(java.util.Date d) {
        if (null == d)
            return null;
        return new java.sql.Timestamp(d.getTime());
    }

    //将数据库Date 转化为java date
    public static java.util.Date ttod(java.sql.Timestamp t) {
        if (null == t)
            return null;
        return new java.util.Date(t.getTime());
    }
}